#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Contact
"""

from google.appengine.ext import db

from contact.models import Model

class Contact(Model):
    """User Contact Class"""
    
    owner = db.StringProperty('owner')
    contact_user = db.StringProperty('已注册用户, 方便加为好友，自动更新')
    primary_id = db.StringProperty('位于用户手机上的主键')
    
    firstname = db.StringProperty('first name')
    lastname = db.StringProperty('last name')
    username = db.StringProperty('user name')
    
    birthday = db.DateTimeProperty()
    
    mobile = db.PhoneNumberProperty('mobile phone number')
    telephone = db.PhoneNumberProperty('telephone')
    work_mobile = db.PhoneNumberProperty('working mobile phone number')
    work_telephone = db.PhoneNumberProperty('working telephone')
    other_mobile = db.PhoneNumberProperty('other mobile phone number')
    other_telephone = db.PhoneNumberProperty('other telephone')
    
    email = db.EmailProperty()
    work_email = db.EmailProperty()
    other_email = db.EmailProperty()
    
    im = db.IMProperty()
    qq = db.StringProperty()
    msn = db.StringProperty()
    gtalk = db.StringProperty()
    
    address = db.TextProperty('current live address')
    home_address = db.TextProperty('home town address')
    work_address = db.TextProperty('working address')
    
    address_postcode = db.StringProperty()
    home_address_postcode = db.StringProperty()
    work_address_postcode = db.StringProperty()
    
    website = db.URLProperty()
    blog = db.URLProperty()
    
    create_time = db.DateTimeProperty('record created_time', 
                                      auto_now_add=True)
    modified_time = db.DateTimeProperty('last modified time', 
                                        auto_now=True)


class User(Model):
    name = db.StringProperty()
    password = db.StringProperty()
    sex = db.CategoryProperty('sex', choices=('1', '2'), # 1: male 2: female
                              default='1')
    register_time = db.DateTimeProperty()
    sync_time = db.DateTimeProperty()